#include <iostream>
#include <memory>
#include "ThreadPool.hpp"
int main()
{
    // std::unique_ptr<ThreadPool<Task>> tp(new ThreadPool<Task>());
    // tp->Start(); // 启动线程
    ThreadPool<Task>::GetInstance()->Start();
    srand(time(nullptr) ^ getpid());
    // 开始放入任务
    while (true)
    {
        int x = rand() % 10;
        usleep(1234);
        int y = rand() % 10;
        usleep(1234);
        char oper = opers[rand() % opers.size()];
        Task t(x, y, oper);
        ThreadPool<Task>::GetInstance()->Push(t);
        sleep(1);
    }
    ThreadPool<Task>::GetInstance()->Wait();

    return 0;
}